import 'package:flutter/material.dart';
import 'package:flutter_hotwork/homepage/BaseTitleBar.dart';
import 'package:flutter_hotwork/homepage/BaseViewBar.dart';
import 'package:flutter_hotwork/utils/DioUtils.dart';

import 'JieSuanNianBao.dart';
import 'JieSuanRiBao.dart';
import 'JieSuanYueBao.dart';
import 'TimeDailyBaobiao.dart';
import 'TimeDayVolumeBaobiao.dart';
import 'TimeYearBaobaio.dart';

class timebaobiaoActivity  extends StatefulWidget {
  @override
  timebaobiaoState createState() => new timebaobiaoState();
}

class timebaobiaoState extends State<timebaobiaoActivity> {
  @override
  void initState() {
    super.initState();
    DioUtils.createInstance();
  }

  @override
  void dispose() {
//    _amapLocation.stopLocate();
    super.dispose();
  }

  TabController _tabController;

  @override
  Widget build(BuildContext context) {
    double rpx = MediaQuery.of(context).size.height / 750;
    return Material(
        child: Scaffold(
      appBar: new BaseViewBar(
          childView: new BaseTitleBar(
            "结算报表",
            leftIcon: 'images/fanhui.png',
            rightIcon: '',
            rightClick: () {},
            leftClick: () {
              print("点击了左边干嘛啊。。。哦");
              Navigator.of(context).pop();
            },
          ),
          preferredSize: Size.fromHeight(50.0)),
      body: Card(
        child: DefaultTabController(
          length: 3,
          child: Column(
            children: [
              TabBar(
                labelColor: Colors.blue,
                unselectedLabelColor: Colors.black,
                indicatorColor: Colors.blue,
                tabs: <Widget>[
                  Tab(text: "每日汽量"),
                  Tab(text: "分时日报"),
                  Tab(text: "分时年报"),
                ],
                controller: _tabController, // 记得要带上tabController
              ),
              Container(
                height: rpx * 596,
                child: TabBarView(
                  controller: _tabController,
                  children: <Widget>[
                    Center(child: timedayvolumebaobiaoPage()),
                    Center(child: timedailtbaobiaoPage()),
                    Center(child: timeyearbaobiaoagePage()),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    ));
  }
}
